package com.travel.sight;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.travel.common.utils.Query;
import com.travel.sight.entity.AttractionInfoEntity;
import com.travel.sight.service.AttractionInfoService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@SpringBootTest
@RunWith(SpringRunner.class)
public class test {
    @Autowired
    AttractionInfoService attractionInfoService;

    @Test
    public void test1(){
        AttractionInfoEntity attractionInfoEntity = new AttractionInfoEntity();
//        attractionInfoEntity.setName("九寨沟");
//        attractionInfoService.save(attractionInfoEntity);
//        attractionInfoEntity.setAttractionId(2);
//        attractionInfoEntity.setClick(111);
//        attractionInfoService.updateById(attractionInfoEntity);

        List<AttractionInfoEntity> list = attractionInfoService.list(new QueryWrapper<AttractionInfoEntity>().eq("attraction_id", 2));
        list.forEach(item->{
            System.out.println(item);
        });

    }
}
